#!/usr/bin/python
import sys
from Adafruit_CharLCD import Adafruit_CharLCD

lcd = Adafruit_CharLCD()

def lcdOff():
    lcd.clear()
    lcd.backlightOff()

def lcdOn():
    lcd.clear()
    lcd.backlightOn()

def usage():
    print "usage:\nbacklight on|off"

if __name__ == '__main__':
    if len(sys.argv) != 2 or sys.argv[1] != 'on' and sys.argv[1] != 'off':
        usage()        
    else:
        if sys.argv[1] == 'on':
            lcdOn()
        else:
            lcdOff()  
